package com.xioyi.news.domain;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import org.hibernate.annotations.Formula;

@MappedSuperclass
public class Common {
	/**
	 * 是否有效
	 */
	protected String	isActive;
	/**
	 * 创建时间
	 */
	protected Date		createTime;
	/**
	 * 创建人ID
	 */
	protected Integer	creator;
	/**
	 * 创建人
	 */
	protected String creatorName;
	/**
	 * 修改时间
	 */
	protected Date		modifyTime;
	/**
	 * 修改人ID
	 */
	protected Integer	modifier;
	
	/**
	 * 修改人
	 */
	protected String modifierName;

	/**
	 * @return the isActive
	 */
	@Column(name = "IS_ACTIVE", length = 1)
	public String getIsActive() {
		return isActive;
	}

	/**
	 * @return the createTime
	 */
	@Column(name = "CREATE_TIME")
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @return the creator
	 */
	@Column(name = "CREATOR")
	public Integer getCreator() {
		return creator;
	}	

	/**
	 * @return the creatorName
	 */
	@Formula("(select t.USER_NAME from  TB_ACCOUNT t where t.ACCOUNT_ID=CREATOR )")
	public String getCreatorName() {
		return creatorName;
	}

	/**
	 * @return the modifyTime
	 */
	@Column(name = "MODIFY_TIME")
	public Date getModifyTime() {
		return modifyTime;
	}

	/**
	 * @return the modifier
	 */
	@Column(name = "MODIFIER")
	public Integer getModifier() {
		return modifier;
	}
	
	/**
	 * @return the modifierName
	 */
	@Formula("(select t.USER_NAME from  TB_ACCOUNT t where t.ACCOUNT_ID=MODIFIER )")
	public String getModifierName() {
		return modifierName;
	}

	/**
	 * @param isActive
	 *            the isActive to set
	 */
	public void setIsActive(String isActive) {
		this.isActive = isActive;
	}

	/**
	 * @param createTime
	 *            the createTime to set
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * @param creator
	 *            the creator to set
	 */
	public void setCreator(Integer creator) {
		this.creator = creator;
	}
	
	/**
	 * @param creatorName the creatorName to set
	 */
	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}


	/**
	 * @param modifyTime
	 *            the modifyTime to set
	 */
	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	/**
	 * @param modifier
	 *            the modifier to set
	 */
	public void setModifier(Integer modifier) {
		this.modifier = modifier;
	}
	
	/**
	 * @param modifierName the modifierName to set
	 */
	public void setModifierName(String modifierName) {
		this.modifierName = modifierName;
	}

}
